package main

import (
	"fmt"
)

var graph = make(map[string]map[string]bool) // a -> dic['a']

//
func addEdge(from, to string) {
	edges := graph[from]
	if edges == nil {
		edges = make(map[string]bool)
		graph[from] = edges
	}
	edges[to] = true

}

func hasEdge(from, to string) bool {
	return graph[from][to]
}

func main() {
	graph["a"] = map[string]bool{
		"a1": true,
		"a2": true,
		"a3": false,
	}
	graph["b"] = map[string]bool{
		"b1": false,
		"b2": true,
		"b3": false,
	}

	var a, b string = "a", "a2"
	var t = hasEdge(a, b)
	fmt.Println(t)
	// fmt.Printf("%t", t)
}
